package exercise;

import java.util.Scanner;

public class EX04_Q31 {
	
	// #31

	public static void main(String[] args) {
		
		BankVO bvo = new BankVO();
		Scanner sc = new Scanner(System.in);
		System.out.print("번호입력 : ");
		bvo.setMycardno(sc.nextInt());
	
		System.out.println(BankService.checkNum(bvo.getMycardno()));
	}

}

class BankVO {
	private int mycardno;
	
	public BankVO() {
	}
	
	public BankVO(int mycardno) {
		this.mycardno = mycardno;
	}
	
	public void setMycardno(int mycardno) {
		this.mycardno = mycardno;
	}
	public int getMycardno() {
		return this.mycardno;
	}	
}

class BankService {
	public static String checkNum (int mycardno) {
		String card = "";
		String bank = "";
		if (mycardno/10000 == 35){
			card = "JCB";
			if (mycardno == 356317) {
				bank = "NH농협카드";
			} else if (mycardno == 356901) {
				bank = "신한카드";
			} else if (mycardno == 356912){
				bank = "KB국민카드";
			} else {
				bank = "일치하는 은행이 없습니다.";
			}
		} else if (mycardno/100000 == 4) {
			card = "비자";
			if (mycardno == 404825) {
				bank = "비씨카드";
			} else if (mycardno == 438676) {
				bank = "신한카드";
			} else if (mycardno == 457973){
				bank = "KB국민카드";
			} else {
				bank = "일치하는 은행이 없습니다.";
			}
		} else if (mycardno/100000 == 5){
			card = "마스타, Maestro";
			if (mycardno == 515594) {
				bank = "신한카드";
			} else if (mycardno == 524353) {
				bank = "외환카드";
			} else if (mycardno == 540926){
				bank = "KB국민카드";
			} else {
				bank = "신한카드";
			}
		} else {
			card = "일치하는 카드사가 없습니다.";
		}
		return card + " " + bank;
	} // checkNum
	
	
} // BankService









